<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>晟峰协同办公平台</title>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	overflow:hidden;
	background-color:#152753;
}
.STYLE3 {font-size: 12px; color: #adc9d9; }
-->
</style>

<script language="javascript" type="text/javascript" src="./js/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="./js/jquery.cookie.js"></script>
<script type="text/javascript">
if (self.location != top.location) { 
	top.location.href = self.location.href; 
}

  //提交表单
  $(function(){
	  var userName = $.cookie("userName");
	  var password = $.cookie("password");
	  if (userName) $('#userName').val(userName);
	  if (password) $('#password').val(password); 
	  
	  $('#login').click(function(){
		  checkLogin();
	  });
  });
  function checkLogin(){
		  var userName = $("#userName").val();
	      var password = $("#password").val();
	      var checkme =$("#checkMe").attr("checked");	     
	       if (userName == null || $.trim(userName) == "") {
				$('.msg-box').html("用户名不能为空或空字符！");
				return false;
	       }
	       if (password == null || $.trim(password) == "") {
	    	    $('.msg-box').html("用户密码不能为空或空字符！");
				return false;
	       }
	       if(checkme){
	    	   $.cookie("userName", userName, {expires: 30, path: '/'});
	    	   $.cookie("password", password, {expires: 30, path: '/'});
		       }
		  
		  //$.cookie("password", password, {expires: 30, path: '/'});
	       /*跳转到正常页面
	       //$('#loginForm').submit();
	       
	       //跳转到无地址无工具栏页面
	       var url="login.action?userName="+userName+"&password="+password;
	       //var width=screen.width-10;
	       //var height=screen.height-66;
	       window.open (url, '_blank', 'fullscreen=1, toolbar=no, menubar=no, scrollbars=no,resizable=yes,location=no, status=no');
	       window.opener=null;
	       window.open("","_self");
	       window.close();
	       return false; */
  }
	   
</script>


</head>

<body>
 
<s:form id="loginForm" method="post" name="login" action="/j_spring_security_check">
<table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#152753">
  <tr>
    <td bgcolor="#1075b1">&nbsp;</td>
  </tr>
  <tr>
    <td height="608" style="background:url(css/base/login-images/login_03.gif) #152753 repeat-x" ><table width="847" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="340" background="css/base/login-images/login_04.gif" valign="bottom" align="center">
        	<div style="margin-bottom:10px; color:#FFFFFF; font-weight:bold;${param.error == true ? '' : 'display:none'}">
        	 ${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}
        	 </div>
        </td>
      </tr>
      <tr>
        <td height="40"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="270" height="84" background="css/base/login-images/login_06.gif">&nbsp;</td>
            <td width="227" valign="middle" background="css/base/login-images/login_07.gif">
            
            <table width="88%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="55" height="24" valign="bottom"><div align="right"><span class="STYLE3">用户：</span></div></td>
                <td width="10" valign="bottom">&nbsp;</td>
                <td width="138" height="24" valign="bottom">
                  <div align="left">
                    <input type="text" name="j_username" id="userName" style="width:100px; height:17px; background-color:#87adbf; border:solid 1px #153966; font-size:12px; color:#283439; ">
                  </div></td>
              </tr>
              <tr>
                <td height="24" valign="bottom"><div align="right"><span class="STYLE3">密码：</span></div></td>
                <td width="10" valign="bottom">&nbsp;</td>
                <td height="24" valign="bottom"><input type="password" name="j_password" id="password" style="width:100px; height:17px; background-color:#87adbf; border:solid 1px #153966; font-size:12px; color:#283439; "></td>
              </tr>
            </table>
            
            </td>
            <td width="26"><img src="css/base/login-images/login_08.gif" width="26" height="84"></td>
            <td width="78" background="css/base/login-images/login_09.gif"><table width="92%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="25"><div id="login" align="center"><input type="submit" value="" style="background:url(css/base/login-images/dl.gif); width:57px; height:20px; border:none; cursor:pointer;"/></div></td>
              </tr>
              <tr>
                <td height="25"><div id="reset" align="center"><input type="reset" value="" style="background:url(css/base/login-images/cz.gif); width:57px; height:20px; border:none; cursor:pointer;"></div></td>
              </tr>
            </table></td>
            <td width="246" style="background:url(css/base/login-images/login_10.gif) no-repeat" >&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="206" style="background:url(css/base/login-images/login_11.gif)  left;text-align:center;vertical-align:top;" >
         	<div style="color:#FFFFFF;margin-top: 8px;"><input type="checkbox" name="checkMe" id="checkMe"/>记住我</div>
        	<!--div style="color:#FFFFFF;margin-top: 8px;"><input type="checkbox" name="_spring_security_remember_me" />两周之内不必登陆</div -->
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#152753">&nbsp;</td>
  </tr>
</table>
</s:form>

</body>
</html>